import PageTools from './PageTools'
import UploadExcel from './UploadExcel'
import ImageUpload from './ImageUpload'
import Lang from './Lang'
import TagsView from './TagsView'

export default {
  // 传入Vue对象
  install(Vue) {
    // 全局注册组件
    Vue.component('PageTools', PageTools)
    Vue.component('UploadExcel', UploadExcel) // 注册导入excel组件
    Vue.component('ImageUpload', ImageUpload) // 注册上传图片组件
    Vue.component('Lang', Lang) // 注册语言包
    Vue.component('TagsView', TagsView) // 注册tab导航
    // 休眠函数
    Vue.prototype.$sleep = function(timer = 500) {
      return new Promise(resolve => setTimeout(() => resolve(), timer))
    }
  }
}
